﻿using System;
using System.Collections.Generic;
using System.Text;

using Obsidian.Utils;
using Obsidian.Edm;
using Obsidian.Data.Sql;
using Oak.Model;

namespace Oak.MagSys.Data
{
    public class FrameDA
    {

        internal List<MsFrameInfo> SelectList(MsFrameQry qry)
        {
            MsFrameInfo f = new MsFrameInfo();
            IDbHandler dbh = f.CreateHandler();
            dbh.SetFields(f.Fields);
            if (!qry.FrameIds.IsNullOrEmpty)
            {
                long[] frameIds = qry.FrameIds.SplitLong(',');
                if(frameIds.Length > 0)
                    dbh.Where(f.FrameId.In(frameIds));
            }
            DataReader dr = dbh.Select();
            return dr.ReadList<MsFrameInfo>();
        }

    }
}
